require "libstarcore"
libstarcore._InitCore(true,true,false,true,"",0,"",0)
SrvGroup = libstarcore:_GetSrvGroup()

SrvGroup:_ImportService("SRPSImgLibEngine",VS_TRUE)
SrvGroup:_CreateService( "","test", "123",5,0,0,0,0,0,"FE62E0EF-F23B-428f-95A3-CE2B193458F5" )    
Service = SrvGroup:_GetService("root","123")

a = Service.SImgLibClass:_New()
In = SrvGroup:_NewBinBuf()
Out = SrvGroup:_NewBinBuf()
In:_LoadFromFile("/9.gif",false)
print(In._Offset)
Delay = SrvGroup:_NewParaPkg()
print(a:DecodeGIF(In,Out,Delay))
print(Out._Offset)

In:_Clear()
print(a:CodeBMP(20,20,Out,In))
In:_SaveToFile("/sss.bmp",false)

In:_Clear()
print(a:CodeJPG(20,20,Out,0.7,In))
In:_SaveToFile("/sss.jpg",false)

In:_Clear()
print(a:CodePNG(20,20,Out,In))
In:_SaveToFile("/sss.png",false)
